import React from "react";
import {Grid, makeStyles, Typography} from "@material-ui/core";

const useStyle = makeStyles(theme => ({
    actions: {
        '& > :not(:last-child)': {
            marginRight: theme.spacing(1.5)
        }
    }
}));

const Toolbar = ({title = '', ...props}) => {
    const classes = useStyle();

    return (
        <Grid item xs={12} container spacing={0}>
            <Grid item xs={4}>
                <Typography variant={"h3"}>{title}</Typography>
            </Grid>
            <Grid item xs={8} container justify="flex-end" className={classes.actions}>
                {props.actions}
            </Grid>
        </Grid>
    );
}

export default Toolbar;
